<?php
// 题库表 migration
use think\migration\Migrator;
use Phinx\Db\Adapter\MysqlAdapter;
class ExamQuestion extends Migrator
{
    public function change()
    {
        $table = $this->table('exam_question');
        $table->addColumn('type', 'string', ['limit' => 16, 'default' => '', 'comment' => '题型: single, multi, judge, blank, short'])
            ->addColumn('content', 'text', ['comment' => '题干'])
            ->addColumn('options', 'text', ['null' => true, 'comment' => '选项(JSON)'])
            ->addColumn('answer', 'text', ['comment' => '标准答案(JSON)'])
            ->addColumn('score', 'integer', ['default' => 1, 'comment' => '分值'])
            ->addColumn('analysis', 'text', ['null' => true, 'comment' => '解析'])
            ->addColumn('create_time', 'integer', ['default' => 0])
            ->addColumn('update_time', 'integer', ['default' => 0])
            ->create();
    }
}
